********************************************************************************
*                                                                              *
*                    How Local Factions Pressure Parties:                      *
*          Activist Groups and Primary Contests in the Tea Party Era           *
*                                                                              *
*                       Rachel M. Blum & Mike Cowburn                          *
*                                                                              *
********************************************************************************

*** Load Data ******************************************************************
cd "XXXXXXXXX" //set to wherever files are stored locally
use "Blum & Cowburn Data.dta" 
xtset geoid year, delta (2)
set more off

*** Histogram of TP Groups By District *****************************************
ssc install cleanplots
set scheme cleanplots
histogram number_tp_groups if year == 2016, discrete frequency fcolor(gs0) lcolor(white) lwidth(none) gap(10) ytitle(Number of Districts) ytitle(, size(medsmall)) ylabel(, glwidth(vvvthin) glcolor(gs2) gextend) ymtick(, grid glwidth(vvvthin) glcolor(gs2)) xtitle(Number of Groups) xtitle(, size(medsmall) justification(right)) xlabel(0(5)30, ticks glwidth(vvvthin) glcolor(gs2) gextend) plotregion(fcolor(none) lcolor(none)) // Figure 1

*** Contested Primaries By District, TP Presence, Year & Type ******************
graph bar (count) if primary_type_clean != "None", over(tp_candidate1014, relabel(1 "No TP" 2 "TP")) over(year) bar(1, fcolor(gs2) lcolor(gs2)) bar(2, fcolor(emidblue) lcolor(gs12)) blabel(bar) ytitle(Number of Contested Primaries) ytitle(, size(smal)) ylabel(, nogrid) title(Primaries by TP Candidate Presence, position(11)) subtitle(2010-2014, size(small) position(11)) legend(order(1 "No TP Candidate" 2 "TP Candidate")) graphregion(ifcolor(none)) plotregion(lcolor(none) ifcolor(none)) // Figure 2

*** Propensity Scores & IPW Construction ***************************************
psmatch2 tp3interacted white_pct median_income median_age density_num dem08, out(recent_presidential_share district_nokkenpoole) common 
psgraph
pstest white_pct median_income median_age density_num dem08
drop iwps3_treated
gen iwps3_treated = 1/_pscore if _treated == 1
recode iwps3_treated (.=0)
drop iwps3_untreated
gen iwps3_untreated = 1/(1-_pscore) if _treated == 0
recode iwps3_untreated (. = 0)
drop iwps3
gen iwps3 = iwps3_treated + iwps3_untreated
set scheme cleanplots
twoway (kdensity _pscore if _treated==1, lcolor(gs2)) (kdensity _pscore if _treated==0, lcolor(gs2) lpattern(dash)), legend(label( 1 "Treated") label( 2 "Control" )) xtitle("Propensity scores BEFORE weighting") ytitle("Density") saving(before, replace) plotregion(fcolor(none) lcolor(none))
twoway (kdensity _pscore if _treated==1 [aw=iwps3], lcolor(gs2)) (kdensity _pscore if _treated==0 [aw=iwps3], lcolor(gs2) lpattern(dash)), legend( label( 1 "Treated") label( 2 "Control" )) xtitle("Propensity scores AFTER weighting") ytitle("Density") saving(weight, replace) plotregion(fcolor(none) lcolor(none))
grc1leg before.gph weight.gph, cols(2) ycommon xcommon subtitle("Before                                                                         After") // Figure 3
save "Blum & Cowburn Data.dta", replace  

// Demonstrate Balance (Table 2)
tabstat iwps3, by(tp3interacted) statistics(count mean sd median max min) columns(statistics)
tabstat white_pct, by(tp3interacted) statistics(count mean sd median max min) columns(statistics)
tabstat median_income, by(tp3interacted) statistics(count mean sd median max min) columns(statistics)
tabstat median_age, by(tp3interacted) statistics(count mean sd median max min) columns(statistics)
tabstat density_num, by(tp3interacted) statistics(count mean sd median max min) columns(statistics)
tabstat dem08, by(tp3interacted) statistics(count mean sd median max min) columns(statistics)
tabstat white_pct [aw=iwps3], by(tp3interacted) statistics(count mean sd median max min) columns(statistics)
tabstat median_income [aw=iwps3], by(tp3interacted) statistics(count mean sd median max min) columns(statistics)
tabstat median_age [aw=iwps3], by(tp3interacted) statistics(count mean sd median max min) columns(statistics)
tabstat density_num [aw=iwps3], by(tp3interacted) statistics(count mean sd median max min) columns(statistics)
tabstat dem08 [aw=iwps3], by(tp3interacted) statistics(count mean sd median max min) columns(statistics)
tabstat _pscore, by(tp3interacted) statistics(count mean sd median max min) columns(statistics)
tabstat _pscore [aw=iwps3], by(tp3interacted) statistics(count mean sd median max min) columns(statistics) 
covbal tp3interacted white_pct median_income median_age density_num dem08 _pscore
covbal tp3interacted white_pct median_income median_age density_num dem08 _pscore, wt(iwps3)

*** Parallel Trends ************************************************************
use "Blum & Cowburn Data.dta", clear 
collapse (mean) recent_presidential_share (sem) se_recent_presidential_share = recent_presidential_share [aweight = iwps3], by(year tp3interacted)
drop if year == 2018 | year == 2006 | year == 2010 | year == 2014
gen upper_ci = recent_presidential_share + (se_recent_presidential_share*1.96)
gen lower_ci = recent_presidential_share - (se_recent_presidential_share*1.96)
reshape wide recent_presidential_share se_recent_presidential_share upper_ci lower_ci, i(year) j(tp3interacted)
graph twoway (line recent_presidential_share0 year, lcolor(gs6) lpattern(dash) lwidth(thick)) (rcap upper_ci0 lower_ci0 year, lcolor(gs6) lpattern(dash) lwidth(thin)) (line recent_presidential_share1 year, lcolor(gs2) lwidth(thick)) (rcap upper_ci1 lower_ci1 year, lcolor(gs2) lwidth(thin)), legend(order(1 "Control" 3 "Treatment") title("Group", size(small))) ytitle("Presidential Vote Share", size(small)) xtitle("Year (Treatment Period: 2010-2014)", size(small)) ylabel(40(5)55) xlabel(2000(4)2016) xline(2012, lwidth(30) lcolor(gs14%50) lpattern(solid)) // Figure 4

use "Blum & Cowburn Data.dta", clear 
collapse (mean) district_nokkenpoole (sem) se_district_nokkenpoole = district_nokkenpoole [aweight = iwps3], by(year tp3interacted)
drop if year == 2000 | year == 2018
gen upper_ci = district_nokkenpoole + (se_district_nokkenpoole*1.96)
gen lower_ci = district_nokkenpoole - (se_district_nokkenpoole*1.96)
reshape wide district_nokkenpoole se_district_nokkenpoole upper_ci lower_ci, i(year) j(tp3interacted)
replace year = 109 in 1
replace year = 110 in 2
replace year = 111 in 3
replace year = 112 in 4
replace year = 113 in 5
replace year = 114 in 6
replace year = 115 in 7
graph twoway (line district_nokkenpoole0 year, lcolor(gs6) lpattern(dash) lwidth(thick)) (rcap upper_ci0 lower_ci0 year, lcolor(gs6) lpattern(dash) lwidth(thin)) (line district_nokkenpoole1 year, lcolor(gs2) lwidth(thick)) (rcap upper_ci1 lower_ci1 year, lcolor(gs2) lwidth(thin)), legend(order(1 "Control" 3 "Treatment") title("Group", size(small))) ytitle("Legislator Position", size(small)) xtitle("Congress (Treatment Period: 112th–114th Congress)", size(small)) xlabel(109(1)115) xline(113, lwidth(50) lcolor(gs14%50) lpattern(solid)) // Figure 5

*** Analysis  ******************************************************************

/// Pres Vote Share ///
use "Blum & Cowburn Data.dta", clear 
diff recent_presidential_share if year ==2008 | year==2016 [aweight = iwps3], t(tp3interacted) p(posttreatment) cl(geoid)
outreg2 using table_diff, ctitle(Pres Vote Share) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3) replace // Table 3

//Raw Republican Vote as H1 Extension, Mechanism Clarification
psmatch2 tp3interacted white_pct median_income median_age density_num dem08, out(pres_vote_raw district_nokkenpoole) common 
drop iwps3_treated_raw
gen iwps3_treated_raw = 1/_pscore if _treated == 1
recode iwps3_treated_raw (.=0)
drop iwps3_untreated_raw
gen iwps3_untreated_raw = 1/(1-_pscore) if _treated == 0
recode iwps3_untreated_raw (. = 0)
drop iwps3_raw
gen iwps3_raw = iwps3_treated_raw + iwps3_untreated_raw

diff pres_vote_raw if year ==2012 | year==2016 [aweight = iwps3_raw], t(tp3interacted) p(posttreatment_2012) cl(geoid) // raw votes use 2012 (redistricted) districts, hence the assignment here - totals from Daily Kos
outreg2 using table_diff, ctitle(Pres Vote Raw) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons replace 

reg pres_vote_raw tp3interacted##posttreatment_2012 [aweight = iwps3_raw], cl(geoid)
coefplot, drop(_cons) xline(0) label // Figure 6

/// Legislator Position ///
use "Blum & Cowburn Data.dta", clear 
diff district_nokkenpoole if year ==2008 | year==2016 [aweight = iwps3], t(tp3interacted) p(posttreatment) cl(geoid) 
outreg2 using table_diff, ctitle(Legislator Position) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3) // Table 4

// Assessing Adaptation vs. Replacement Using NOMINATE
diff district_nominate if year ==2008 | year==2016 [aweight = iwps3], t(tp3interacted) p(posttreatment) cl(geoid) // almost all of the effect is from replacement (0.103 of 0.126)
outreg2 using table_diff, ctitle(NOMINATE) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3) replace // Table 5

********************************************************************************
*                                                                              *
*                         Supplementary Material                               *
*                                                                              *
********************************************************************************

******************* Descriptive Statistics *************************************

asdoc cor recent_presidential_share district_nokkenpoole tp3interacted tp_candidate1014treat tp_treatment3 median_income white_pct median_age density_num dem08, label replace // Table A1

bys year: asdoc sum district_nokkenpoole recent_presidential_share // Table A2
asdoc corr district_nokkenpoole recent_presidential_share if year == 2008 & tp3interacted == 1
asdoc corr district_nokkenpoole recent_presidential_share if year == 2008 & tp3interacted == 0
asdoc corr district_nokkenpoole recent_presidential_share if year == 2016 & tp3interacted == 1
asdoc corr district_nokkenpoole recent_presidential_share if year == 2016 & tp3interacted == 0

twoway (scatter pres_vote_change_0816 district_nokken_poole_0816 if year == 2016 & tp3interacted == 1) ///
	(scatter pres_vote_change_0816 district_nokken_poole_0816 if year == 2016 & tp3interacted == 0) ///
	(lfit pres_vote_change_0816 district_nokken_poole_0816 if year == 2016 & tp3interacted == 1) ///
	(lfit pres_vote_change_0816 district_nokken_poole_0816 if year == 2016 & tp3interacted == 0), ytitle(Change in Pres Vote Share, size(small)) ylabel(, nogrid) title(Correlation Between Change in Dependent Variables, position(11)) subtitle(2008-2016, 	size(small) position(11)) legend(order(1 "Treatment Districts" 2 "Control Districts" 3 "Treatment (Fitted)" 4 "Control (Fitted)")) graphregion(ifcolor(none)) plotregion(lcolor(none) ifcolor(none)) // Figure A1

scatter number_tp_groups recent_presidential_share if year ==2008 | year == 2016, xtitle(% Presidential Vote Share, size(small)) ytitle(Number of Tea Party Groups, size(small)) ylabel(, nogrid) title(Correlation Between Number of Tea Party Groups and Presidential Vote Share, size(medium-small)position(11)) subtitle(2008-2016, size(small) position(11)) graphregion(ifcolor(none)) plotregion(lcolor(none) ifcolor(none)) yscale(lcolor(gs12)) ylabel(, tlcolor(gs12)) xscale(lcolor(gs12)) xlabel(, labcolor(black) tlcolor(gs12)) // Figure A2

graph bar (count) if year < 2016 & year > 2008 & primary_type_clean != "None", over(tp_candidate1014) over(primary_type_clean, label(labsize(vsmall))) over(year) bar(1, fcolor(gs2) lcolor(gs2)) bar(2, fcolor(gs12) lcolor(gs12)) ytitle(Number of Contested Primaries) ytitle(, size(small)) title(Primaries by Type & TP Candidate Presence, position(11)) subtitle(2010-2014, size(small) position(11)) legend(order(1 "No TP Candidate" 2 "TP Candidate")) graphregion(ifcolor(none)) plotregion(lcolor(none) ifcolor(none)) // Figure A3

******************* District Assignment ****************************************

/// Presentation of 'Raw' PTA ///

//H1
use "Blum & Cowburn Data.dta", clear 
collapse (mean) recent_presidential_share (sem) se_recent_presidential_share = recent_presidential_share, by(year tp3interacted)
drop if year == 2018 | year == 2006 | year == 2010 | year == 2014
gen upper_ci = recent_presidential_share + (se_recent_presidential_share*1.96)
gen lower_ci = recent_presidential_share - (se_recent_presidential_share*1.96)
reshape wide recent_presidential_share se_recent_presidential_share upper_ci lower_ci, i(year) j(tp3interacted)
graph twoway (line recent_presidential_share0 year, lcolor(gs6) lpattern(dash) lwidth(thick)) (rcap upper_ci0 lower_ci0 year, lcolor(gs6) lpattern(dash) lwidth(thin)) (line recent_presidential_share1 year, lcolor(gs2) lwidth(thick)) (rcap upper_ci1 lower_ci1 year, lcolor(gs2) lwidth(thin)), legend(order(1 "Control" 3 "Treatment") title("Group", size(small))) ytitle("Presidential Vote Share", size(small)) xtitle("Year (Treatment Period: 2010-2014)", size(small)) ylabel(35(5)55) xlabel(2000(4)2016) xline(2012, lwidth(30) lcolor(gs14%50) lpattern(solid)) // Figure B1

//H2
use "Blum & Cowburn Data.dta", clear 
collapse (mean) district_nokkenpoole (sem) se_district_nokkenpoole = district_nokkenpoole, by(year tp3interacted)
drop if year == 2000 | year == 2018
gen upper_ci = district_nokkenpoole + (se_district_nokkenpoole*1.96)
gen lower_ci = district_nokkenpoole - (se_district_nokkenpoole*1.96)
reshape wide district_nokkenpoole se_district_nokkenpoole upper_ci lower_ci, i(year) j(tp3interacted)
replace year = 109 in 1
replace year = 110 in 2
replace year = 111 in 3
replace year = 112 in 4
replace year = 113 in 5
replace year = 114 in 6
replace year = 115 in 7
graph twoway (line district_nokkenpoole0 year, lcolor(gs6) lpattern(dash) lwidth(thick)) (rcap upper_ci0 lower_ci0 year, lcolor(gs6) lpattern(dash) lwidth(thin)) (line district_nokkenpoole1 year, lcolor(gs2) lwidth(thick)) (rcap upper_ci1 lower_ci1 year, lcolor(gs2) lwidth(thin)), legend(order(1 "Control" 3 "Treatment") title("Group", size(small))) ytitle("Legislator Position", size(small)) xtitle("Congress (Treatment Period: 112th–114th Congress)", size(small)) xlabel(109(1)115) xline(113, lwidth(50) lcolor(gs14%50) lpattern(solid)) // Figure B2


/// IPW With Other Numbers of TP Groups ///
use "Blum & Cowburn Data.dta", clear 
//Generate New Propensity Scores
psmatch2 tp1interacted white_pct median_income median_age density_num dem08, out(recent_presidential_share district_nokkenpoole) common 
drop iwps1_treated
gen iwps1_treated = 1/_pscore if _treated == 1
recode iwps1_treated (.=0)
drop iwps1_untreated
gen iwps1_untreated = 1/(1-_pscore) if _treated == 0
recode iwps1_untreated (. = 0)
drop iwps1
gen iwps1 = iwps1_treated + iwps1_untreated

psmatch2 tp2interacted white_pct median_income median_age density_num dem08, out(recent_presidential_share district_nokkenpoole) common 
drop iwps2_treated
gen iwps2_treated = 1/_pscore if _treated == 1
recode iwps2_treated (.=0)
drop iwps2_untreated
gen iwps2_untreated = 1/(1-_pscore) if _treated == 0
recode iwps2_untreated (. = 0)
drop iwps2
gen iwps2 = iwps2_treated + iwps2_untreated

psmatch2 tp4interacted white_pct median_income median_age density_num dem08, out(recent_presidential_share district_nokkenpoole) common 
drop iwps4_treated
gen iwps4_treated = 1/_pscore if _treated == 1
recode iwps4_treated (.=0)
drop iwps4_untreated
gen iwps4_untreated = 1/(1-_pscore) if _treated == 0
recode iwps4_untreated (. = 0)
drop iwps4
gen iwps4 = iwps4_treated + iwps4_untreated

psmatch2 tp5interacted white_pct median_income median_age density_num dem08, out(recent_presidential_share district_nokkenpoole) common 
drop iwps5_treated
gen iwps5_treated = 1/_pscore if _treated == 1
recode iwps5_treated (.=0)
drop iwps5_untreated
gen iwps5_untreated = 1/(1-_pscore) if _treated == 0
recode iwps5_untreated (. = 0)
drop iwps5
gen iwps5 = iwps5_treated + iwps5_untreated

psmatch2 tp6interacted white_pct median_income median_age density_num dem08, out(recent_presidential_share district_nokkenpoole) common
drop iwps6_treated
gen iwps6_treated = 1/_pscore if _treated == 1
recode iwps6_treated (.=0)
drop iwps6_untreated
gen iwps6_untreated = 1/(1-_pscore) if _treated == 0
recode iwps6_untreated (. = 0)
drop iwps6
gen iwps6 = iwps6_treated + iwps6_untreated

// TP1 
tabstat iwps1, by(tp1interacted) statistics(count mean sd median max min) columns(statistics)
tabstat white_pct, by(tp1interacted) statistics(count mean sd median max min) columns(statistics)
tabstat median_income, by(tp1interacted) statistics(count mean sd median max min) columns(statistics)
tabstat median_age, by(tp1interacted) statistics(count mean sd median max min) columns(statistics)
tabstat density_num, by(tp1interacted) statistics(count mean sd median max min) columns(statistics)
tabstat dem08, by(tp1interacted) statistics(count mean sd median max min) columns(statistics)
tabstat white_pct [aw=iwps1], by(tp1interacted) statistics(count mean sd median max min) columns(statistics)
tabstat median_income [aw=iwps1], by(tp1interacted) statistics(count mean sd median max min) columns(statistics)
tabstat median_age [aw=iwps1], by(tp1interacted) statistics(count mean sd median max min) columns(statistics)
tabstat density_num [aw=iwps1], by(tp1interacted) statistics(count mean sd median max min) columns(statistics)
tabstat dem08 [aw=iwps1], by(tp1interacted) statistics(count mean sd median max min) columns(statistics)
covbal tp1interacted white_pct median_income median_age density_num dem08
covbal tp1interacted white_pct median_income median_age density_num dem08, wt(iwps1) 

// TP2
tabstat iwps2, by(tp2interacted) statistics(count mean sd median max min) columns(statistics)
tabstat white_pct, by(tp2interacted) statistics(count mean sd median max min) columns(statistics)
tabstat median_income, by(tp2interacted) statistics(count mean sd median max min) columns(statistics)
tabstat median_age, by(tp2interacted) statistics(count mean sd median max min) columns(statistics)
tabstat density_num, by(tp2interacted) statistics(count mean sd median max min) columns(statistics)
tabstat dem08, by(tp2interacted) statistics(count mean sd median max min) columns(statistics)
tabstat white_pct [aw=iwps2], by(tp2interacted) statistics(count mean sd median max min) columns(statistics)
tabstat median_income [aw=iwps2], by(tp2interacted) statistics(count mean sd median max min) columns(statistics)
tabstat median_age [aw=iwps2], by(tp2interacted) statistics(count mean sd median max min) columns(statistics)
tabstat density_num [aw=iwps2], by(tp2interacted) statistics(count mean sd median max min) columns(statistics)
tabstat dem08 [aw=iwps2], by(tp2interacted) statistics(count mean sd median max min) columns(statistics)
covbal tp2interacted white_pct median_income median_age density_num dem08
covbal tp2interacted white_pct median_income median_age density_num dem08, wt(iwps2)   

// TP3 (Used in Main Analysis)
tabstat iwps3, by(tp3interacted) statistics(count mean sd median max min) columns(statistics)
tabstat white_pct, by(tp3interacted) statistics(count mean sd median max min) columns(statistics)
tabstat median_income, by(tp3interacted) statistics(count mean sd median max min) columns(statistics)
tabstat median_age, by(tp3interacted) statistics(count mean sd median max min) columns(statistics)
tabstat density_num, by(tp3interacted) statistics(count mean sd median max min) columns(statistics)
tabstat dem08, by(tp3interacted) statistics(count mean sd median max min) columns(statistics)
tabstat white_pct [aw=iwps3], by(tp3interacted) statistics(count mean sd median max min) columns(statistics)
tabstat median_income [aw=iwps3], by(tp3interacted) statistics(count mean sd median max min) columns(statistics)
tabstat median_age [aw=iwps3], by(tp3interacted) statistics(count mean sd median max min) columns(statistics)
tabstat density_num [aw=iwps3], by(tp3interacted) statistics(count mean sd median max min) columns(statistics)
tabstat dem08 [aw=iwps3], by(tp3interacted) statistics(count mean sd median max min) columns(statistics)
covbal tp3interacted white_pct median_income median_age density_num dem08
covbal tp3interacted white_pct median_income median_age density_num dem08, wt(iwps3)   

// TP4
tabstat iwps4, by(tp4interacted) statistics(count mean sd median max min) columns(statistics)
tabstat white_pct, by(tp4interacted) statistics(count mean sd median max min) columns(statistics)
tabstat median_income, by(tp4interacted) statistics(count mean sd median max min) columns(statistics)
tabstat median_age, by(tp4interacted) statistics(count mean sd median max min) columns(statistics)
tabstat density_num, by(tp4interacted) statistics(count mean sd median max min) columns(statistics)
tabstat dem08, by(tp4interacted) statistics(count mean sd median max min) columns(statistics)
tabstat white_pct [aw=iwps4], by(tp4interacted) statistics(count mean sd median max min) columns(statistics)
tabstat median_income [aw=iwps4], by(tp4interacted) statistics(count mean sd median max min) columns(statistics)
tabstat median_age [aw=iwps4], by(tp4interacted) statistics(count mean sd median max min) columns(statistics)
tabstat density_num [aw=iwps4], by(tp4interacted) statistics(count mean sd median max min) columns(statistics)
tabstat dem08 [aw=iwps4], by(tp4interacted) statistics(count mean sd median max min) columns(statistics)
covbal tp4interacted white_pct median_income median_age density_num dem08
covbal tp4interacted white_pct median_income median_age density_num dem08, wt(iwps4)

// TP5
tabstat iwps5, by(tp5interacted) statistics(count mean sd median max min) columns(statistics)
tabstat white_pct, by(tp5interacted) statistics(count mean sd median max min) columns(statistics)
tabstat median_income, by(tp5interacted) statistics(count mean sd median max min) columns(statistics)
tabstat median_age, by(tp5interacted) statistics(count mean sd median max min) columns(statistics)
tabstat density_num, by(tp5interacted) statistics(count mean sd median max min) columns(statistics)
tabstat dem08, by(tp5interacted) statistics(count mean sd median max min) columns(statistics)
tabstat white_pct [aw=iwps5], by(tp5interacted) statistics(count mean sd median max min) columns(statistics)
tabstat median_income [aw=iwps5], by(tp5interacted) statistics(count mean sd median max min) columns(statistics)
tabstat median_age [aw=iwps5], by(tp5interacted) statistics(count mean sd median max min) columns(statistics)
tabstat density_num [aw=iwps5], by(tp5interacted) statistics(count mean sd median max min) columns(statistics)
tabstat dem08 [aw=iwps5], by(tp5interacted) statistics(count mean sd median max min) columns(statistics)
covbal tp5interacted white_pct median_income median_age density_num dem08
covbal tp5interacted white_pct median_income median_age density_num dem08, wt(iwps5)

// TP6
tabstat iwps2, by(tp6interacted) statistics(count mean sd median max min) columns(statistics)
tabstat white_pct, by(tp6interacted) statistics(count mean sd median max min) columns(statistics)
tabstat median_income, by(tp6interacted) statistics(count mean sd median max min) columns(statistics)
tabstat median_age, by(tp6interacted) statistics(count mean sd median max min) columns(statistics)
tabstat density_num, by(tp6interacted) statistics(count mean sd median max min) columns(statistics)
tabstat dem08, by(tp6interacted) statistics(count mean sd median max min) columns(statistics)
tabstat white_pct [aw=iwps6], by(tp6interacted) statistics(count mean sd median max min) columns(statistics)
tabstat median_income [aw=iwps6], by(tp6interacted) statistics(count mean sd median max min) columns(statistics)
tabstat median_age [aw=iwps6], by(tp6interacted) statistics(count mean sd median max min) columns(statistics)
tabstat density_num [aw=iwps6], by(tp6interacted) statistics(count mean sd median max min) columns(statistics)
tabstat dem08 [aw=iwps6], by(tp6interacted) statistics(count mean sd median max min) columns(statistics)
covbal tp6interacted white_pct median_income median_age density_num dem08
covbal tp6interacted white_pct median_income median_age density_num dem08, wt(iwps6)

*******************Robustness Checks********************************************

/// Moving TP Groups Boundary ///

// Pres Vote Share
diff recent_presidential_share if year ==2008 | year==2016 [aweight = iwps1], t(tp1interacted) p(posttreatment) cl(geoid) 
outreg2 using table_diff, ctitle(Pres Vote Share) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3) replace
diff recent_presidential_share if year ==2008 | year==2016 [aweight = iwps2], t(tp2interacted) p(posttreatment) cl(geoid) 
outreg2 using table_diff, ctitle(Pres Vote Share) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3)
diff recent_presidential_share if year ==2008 | year==2016 [aweight = iwps4], t(tp4interacted) p(posttreatment) cl(geoid) 
outreg2 using table_diff, ctitle(Pres Vote Share) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3)
diff recent_presidential_share if year ==2008 | year==2016 [aweight = iwps5], t(tp5interacted) p(posttreatment) cl(geoid) 
outreg2 using table_diff, ctitle(Pres Vote Share) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3)
diff recent_presidential_share if year ==2008 | year==2016 [aweight = iwps6], t(tp6interacted) p(posttreatment) cl(geoid) 
outreg2 using table_diff, ctitle(Pres Vote Share) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3)

// Leg Position
diff district_nokkenpoole if year ==2008 | year==2016 [aweight = iwps1], t(tp1interacted) p(posttreatment) cl(geoid) 
outreg2 using table_diff, ctitle(Leg Position) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3) replace
diff district_nokkenpoole if year ==2008 | year==2016 [aweight = iwps2], t(tp2interacted) p(posttreatment) cl(geoid) 
outreg2 using table_diff, ctitle(Leg Position) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3)
diff district_nokkenpoole if year ==2008 | year==2016 [aweight = iwps4], t(tp4interacted) p(posttreatment) cl(geoid) 
outreg2 using table_diff, ctitle(Leg Position) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3)
diff district_nokkenpoole if year ==2008 | year==2016 [aweight = iwps5], t(tp5interacted) p(posttreatment) cl(geoid) 
outreg2 using table_diff, ctitle(Leg Position) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3)
diff district_nokkenpoole if year ==2008 | year==2016 [aweight = iwps6], t(tp6interacted) p(posttreatment) cl(geoid) 
outreg2 using table_diff, ctitle(Leg Position) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3)

/// Effect just using TP Group Presence ///

psmatch2 tp_treatment3 white_pct median_income median_age density_num dem08, out(recent_presidential_share district_nokkenpoole) common 
drop iwps3_tpgroups_treated
gen iwps3_tpgroups_treated = 1/_pscore if _treated == 1
recode iwps3_tpgroups_treated (.=0)
drop iwps3_tpgroups_untreated
gen iwps3_tpgroups_untreated = 1/(1-_pscore) if _treated == 0
recode iwps3_tpgroups_untreated (. = 0)
drop iwps3_tpgroups
gen iwps3_tpgroups = iwps3_tpgroups_treated + iwps3_tpgroups_untreated

diff recent_presidential_share if year ==2008 | year==2016 [aweight = iwps3_tpgroups], t(tp_treatment3) p(posttreatment) cl(geoid)
outreg2 using table_diff, ctitle(Pres Vote Share) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3) replace
diff district_nokkenpoole if year ==2008 | year==2016 [aweight = iwps3_tpgroups], t(tp_treatment3) p(posttreatment) cl(geoid)
outreg2 using table_diff, ctitle(Leg Position) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3)

/// Effect just using TP Primaries ///

psmatch2 tp_candidate1014treat white_pct median_income median_age density_num dem08, out(recent_presidential_share district_nokkenpoole) common 
drop iwps3_tpprim_treated
gen iwps3_tpprim_treated = 1/_pscore if _treated == 1
recode iwps3_tpprim_treated (.=0)
drop iwps3_tpprim_untreated
gen iwps3_tpprim_untreated = 1/(1-_pscore) if _treated == 0
recode iwps3_tpprim_untreated (. = 0)
drop iwps3_tpprim
gen iwps3_tpprim = iwps3_tpprim_treated + iwps3_tpprim_untreated

diff recent_presidential_share if year ==2008 | year==2016 [aweight = iwps3_tpprim], t(tp_candidate1014treat) p(posttreatment) cl(geoid)
outreg2 using table_diff, ctitle(Pres Vote Share) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3) replace
diff district_nokkenpoole if year ==2008 | year==2016 [aweight = iwps3_tpprim], t(tp_candidate1014treat) p(posttreatment) cl(geoid)
outreg2 using table_diff, ctitle(Leg Position) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3) replace

/// Robustness Check Requiring >25% Primary Vote Share ///

psmatch2 tp3interactedthresh white_pct median_income median_age density_num dem08, out(recent_presidential_share district_nokkenpoole) common 
drop iwps3_thresh_treated
gen iwps3_thresh_treated = 1/_pscore if _treated == 1
recode iwps3_thresh_treated (.=0)
drop iwps3_thresh_untreated
gen iwps3_thresh_untreated = 1/(1-_pscore) if _treated == 0
recode iwps3_thresh_untreated (. = 0)
drop iwps3_thresh
gen iwps3_thresh = iwps3_thresh_treated + iwps3_thresh_untreated

diff recent_presidential_share if year ==2008 | year==2016 [aweight = iwps3], t(tp3interactedthresh) p(posttreatment) cl(geoid)
outreg2 using table_diff, ctitle(Pres Vote Share) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3) replace
diff district_nokkenpoole if year ==2008 | year==2016 [aweight = iwps3], t(tp3interactedthresh) p(posttreatment) cl(geoid)
outreg2 using table_diff, ctitle(Leg Position) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3)

/// Robustness Check Requiring >0$ Raised ///

psmatch2 interactedtreatmentreceipts white_pct median_income median_age density_num dem08, out(recent_presidential_share district_nokkenpoole) common 
drop iwps3_receipts_treated
gen iwps3_receipts_treated = 1/_pscore if _treated == 1
recode iwps3_receipts_treated (.=0)
drop iwps3_receipts_untreated
gen iwps3_receipts_untreated = 1/(1-_pscore) if _treated == 0
recode iwps3_receipts_untreated (. = 0)
drop iwps3_receipts
gen iwps3_receipts = iwps3_receipts_treated + iwps3_receipts_untreated

diff recent_presidential_share if year ==2008 | year==2016 [aweight = iwps3_receipts], t(interactedtreatmentreceipts) p(posttreatment) cl(geoid)
outreg2 using table_diff, ctitle(Pres Vote Share) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3) replace
diff district_nokkenpoole if year ==2008 | year==2016 [aweight = iwps3_receipts], t(interactedtreatmentreceipts) p(posttreatment) cl(geoid)
outreg2 using table_diff, ctitle(Leg Position) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3)

/// Robustness Check Only 'Quality' Candidates ///

psmatch2 tp3interactedquality white_pct median_income median_age density_num dem08, out(recent_presidential_share district_nokkenpoole) common 
drop iwps3_quality_treated
gen iwps3_quality_treated = 1/_pscore if _treated == 1
recode iwps3_quality_treated (.=0)
drop iwps3_quality_untreated
gen iwps3_quality_untreated = 1/(1-_pscore) if _treated == 0
recode iwps3_quality_untreated (. = 0)
drop iwps3_quality
gen iwps3_quality = iwps3_quality_treated + iwps3_quality_untreated

diff recent_presidential_share if year ==2008 | year==2016 [aweight = iwps3_quality], t(tp3interactedquality) p(posttreatment) cl(geoid)
outreg2 using table_diff, ctitle(Pres Vote Share (Quality Only)) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3) replace
diff district_nokkenpoole if year ==2008 | year==2016 [aweight = iwps3_quality], t(tp3interactedquality) p(posttreatment) cl(geoid)
outreg2 using table_diff, ctitle(Leg Position (Quality Only)) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3)

/// Robustness Check 12-14 Primaries (Counter to 2010 Wave Election Narrative) ///

psmatch2 interactedcandidate1214 white_pct median_income median_age density_num dem08, out(recent_presidential_share district_nokkenpoole) common 
drop iwps3_1214_treated
gen iwps3_1214_treated = 1/_pscore if _treated == 1
recode iwps3_1214_treated (.=0)
drop iwps3_1214_untreated
gen iwps3_1214_untreated = 1/(1-_pscore) if _treated == 0
recode iwps3_1214_untreated (. = 0)
drop iwps3_1214
gen iwps3_1214 = iwps3_1214_treated + iwps3_1214_untreated

diff recent_presidential_share if year ==2008 | year==2016 [aweight = iwps3_1214], t(interactedcandidate1214) p(posttreatment) cl(geoid)
outreg2 using table_diff, ctitle(Pres Vote Share) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3) replace
diff district_nokkenpoole if year ==2008 | year==2016 [aweight = iwps3_1214], t(interactedcandidate1214) p(posttreatment) cl(geoid)
outreg2 using table_diff, ctitle(Leg Position) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3)

/// Using Fixed Weights Based on 2008 District Boundaries ///

diff recent_presidential_share if year ==2008 | year==2016 [aweight = weight2008], t(tp3interacted) p(posttreatment) 
outreg2 using table_diff, ctitle(Pres Vote Share) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3) replace
diff district_nokkenpoole if year ==2008 | year==2016 [aweight = weight2008], t(tp3interacted) p(posttreatment) cl(geoid)
outreg2 using table_diff, ctitle(Leg Position) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3)

/// Robustness Check Using All TP Candidates ///

psmatch2 tpcandidateanyinteracted white_pct median_income median_age density_num dem08, out(recent_presidential_share district_nokkenpoole) common 
drop iwps3_alltp_treated
gen iwps3_alltp_treated = 1/_pscore if _treated == 1
recode iwps3_alltp_treated (.=0)
drop iwps3_alltp_untreated
gen iwps3_alltp_untreated = 1/(1-_pscore) if _treated == 0
recode iwps3_alltp_untreated (. = 0)
drop iwps3_alltp
gen iwps3_alltp = iwps3_alltp_treated + iwps3_alltp_untreated

diff recent_presidential_share if year ==2008 | year==2016 [aweight = iwps3_alltp], t(tpcandidateanyinteracted) p(posttreatment) 
outreg2 using table_diff, ctitle(Pres Vote Share - IWPT) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3) replace 
diff district_nokkenpoole if year ==2008 | year==2016 [aweight = iwps3_alltp], t(tpcandidateanyinteracted) p(posttreatment) 
outreg2 using table_diff, ctitle(Leg Position - IWPT) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3)

/// Robustness Check Including 2016 'Tea Party' Primaries ///

psmatch2 tp3interacted16 white_pct median_income median_age density_num dem08, out(recent_presidential_share district_nokkenpoole) common 
drop iwps3_16_treated
gen iwps3_16_treated = 1/_pscore if _treated == 1
recode iwps3_16_treated (.=0)
drop iwps3_16_untreated
gen iwps3_16_untreated = 1/(1-_pscore) if _treated == 0
recode iwps3_16_untreated (. = 0)
drop iwps3_16
gen iwps3_16 = iwps3_16_treated + iwps3_16_untreated

diff recent_presidential_share if year ==2008 | year==2016 [aweight = iwps3_16], t(tp3interacted16) p(posttreatment) 
outreg2 using table_diff, ctitle(Pres Vote Share - Inc 2016 Primaries) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons replace dec(3)
diff district_nokkenpoole if year ==2008 | year==2016 [aweight = iwps3_16], t(tp3interacted16) p(posttreatment) 
outreg2 using table_diff, ctitle(Leg Position - Inc 2016 Primaries) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3)

/// H2 2018 Post (Trump not on Ballot) ///

diff district_nokkenpoole if year ==2008 | year==2018 [aweight = iwps3], t(tp3interacted) p(posttreatment) 
outreg2 using table_diff, ctitle(Leg Position) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3) replace

/// Adding Representative Replacement as a Further Control ///

diff recent_presidential_share if year ==2008 | year==2016 [aweight = iwps3], t(tp3interacted) p(posttreatment) cov(repchangedummy1 repchangedummy2 repchangedummy3plus) cl(geoid) report
outreg2 using table_diff, ctitle(Pres Vote Share) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3) replace
diff district_nokkenpoole if year ==2008 | year==2016 [aweight = iwps3], t(tp3interacted) p(posttreatment) cov(repchangedummy1 repchangedummy2 repchangedummy3plus) cl(geoid) report
outreg2 using table_diff, ctitle(Leg Position) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3)

/// Including Lagged DVs as controls ///

diff recent_presidential_share if year ==2008 | year==2016 [aweight = iwps3], t(tp3interacted) p(posttreatment) cov(lagged_pres_vote_share) cl(geoid) 
outreg2 using table_diff, ctitle(Pres Vote Share) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3) replace
diff district_nokkenpoole if year ==2008 | year==2016 [aweight = iwps3], t(tp3interacted) p(posttreatment) cov(lagged_nokkenpoole) cl(geoid) 
outreg2 using table_diff, ctitle(Leg Position) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3)

/// Including alternative DV as controls ///

diff recent_presidential_share if year ==2008 | year==2016 [aweight = iwps3], t(tp3interacted) p(posttreatment) cov(district_nokkenpoole) cl(geoid)
outreg2 using table_diff, ctitle(Pres Vote Share) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3) replace
diff district_nokkenpoole if year ==2008 | year==2016 [aweight = iwps3], t(tp3interacted) p(posttreatment) cov(recent_presidential_share) cl(geoid)
outreg2 using table_diff, ctitle(Leg Position) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3)

/// Doubly Robust Estimators Comparison (Identical) ///

drdid recent_presidential_share if year ==2008 | year==2016 [iweight = iwps3], time(year) treatment(tp3interacted) cluster(geoid) all
outreg2 using table_diff, ctitle(Pres Vote Share) label word nocons dec(3) replace
drdid district_nokkenpoole if year ==2008 | year==2016 [iweight = iwps3], time(year) treatment(tp3interacted) cluster(geoid) all
outreg2 using table_diff, ctitle(Legislator Position) label word nocons dec(3)

/// More Granular Controls for Partisanship ///

// Including Pretreatment Partisan Index and 2008 PVI as Controls

diff recent_presidential_share if year ==2008 | year==2016 [aweight = iwps3], t(tp3interacted) p(posttreatment) cov(partisan_index) cl(geoid) report
outreg2 using table_diff, ctitle(Pres Vote Share (Partisan Index Control)) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3) replace
diff district_nokkenpoole if year ==2008 | year==2016 [aweight = iwps3], t(tp3interacted) p(posttreatment) cov(partisan_index) cl(geoid) report
outreg2 using table_diff, ctitle(Legislator Position (Partisan Index Control)) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3)
diff recent_presidential_share if year ==2008 | year==2016 [aweight = iwps3], t(tp3interacted) p(posttreatment) cov(pvi08) cl(geoid) report
outreg2 using table_diff, ctitle(Pres Vote Share (2008 PVI Control)) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3) 
diff district_nokkenpoole if year ==2008 | year==2016 [aweight = iwps3], t(tp3interacted) p(posttreatment) cov(pvi08) cl(geoid) report
outreg2 using table_diff, ctitle(Legislator Position (2008 PVI Control)) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3)

// Including Pretreatment Partisan Index in Propensity Score Estimation
psmatch2 tp3interacted white_pct median_income median_age density_num partisan_index, out(recent_presidential_share district_nokkenpoole) common 
drop iwps3_treated_index
gen iwps3_treated_index = 1/_pscore if _treated == 1
recode iwps3_treated_index (.=0)
drop iwps3_untreated_index
gen iwps3_untreated_index = 1/(1-_pscore) if _treated == 0
recode iwps3_untreated_index (. = 0)
drop iwps3_index
gen iwps3_index = iwps3_treated_index + iwps3_untreated_index

diff recent_presidential_share if year == 2008 | year ==2016 [aweight = iwps3_index], t(tp3interacted) p(posttreatment) cl(geoid) // non-sig but directionally aligned
outreg2 using table_diff, ctitle(Pres Vote Share (Partisan Index Weighting)) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3) replace
diff district_nokkenpoole if year == 2008 | year ==2016 [aweight = iwps3_index], t(tp3interacted) p(posttreatment) cl(geoid) // remains sig
outreg2 using table_diff, ctitle(Legislator Position (Partisan Index Weighting)) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3)

// Including 2008 PVI in Propensity Score Estimation
psmatch2 tp3interacted white_pct median_income median_age density_num pvi08, out(recent_presidential_share district_nokkenpoole) common 
psgraph
pstest white_pct median_income
drop iwps3_treated_granular
gen iwps3_treated_granular = 1/_pscore if _treated == 1
recode iwps3_treated_granular (.=0)
drop iwps3_untreated_granular
gen iwps3_untreated_granular = 1/(1-_pscore) if _treated == 0
recode iwps3_untreated_granular (. = 0)
drop iwps3_granular
gen iwps3_granular = iwps3_treated_granular + iwps3_untreated_granular

diff recent_presidential_share if year == 2008 | year ==2016 [aweight = iwps3_granular], t(tp3interacted) p(posttreatment) cl(geoid) // non-sig but directionally aligned
outreg2 using table_diff, ctitle(Pres Vote Share (2008 PVI Weighting)) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3)
diff district_nokkenpoole if year == 2008 | year ==2016 [aweight = iwps3_granular], t(tp3interacted) p(posttreatment) cl(geoid) // non-sig but directionally aligned
outreg2 using table_diff, ctitle(Legislator Position (2008 PVI Weighting)) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3)

/// Placebo Tests ///

// Placebo Test with Alternative Treatment (2008 Partisanship)
//H1
diff recent_presidential_share if year ==2008 | year==2016 [aweight = iwps3], t(rep08) p(posttreatment) cl(geoid) // no movement H1
outreg2 using table_diff, ctitle(Pres Vote Share) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3) replace

use "Blum & Cowburn Data.dta", clear 
collapse (mean) recent_presidential_share (sem) se_recent_presidential_share = recent_presidential_share [aweight = iwps3], by(year rep08)
drop if year == 2018 | year == 2006 | year == 2010 | year == 2014
gen upper_ci = recent_presidential_share + (se_recent_presidential_share*1.96)
gen lower_ci = recent_presidential_share - (se_recent_presidential_share*1.96)
reshape wide recent_presidential_share se_recent_presidential_share upper_ci lower_ci, i(year) j(rep08)
graph twoway (line recent_presidential_share0 year, lcolor(gs6) lpattern(dash) lwidth(thick)) (rcap upper_ci0 lower_ci0 year, lcolor(gs6) lpattern(dash) lwidth(thin)) (line recent_presidential_share1 year, lcolor(gs2) lwidth(thick)) (rcap upper_ci1 lower_ci1 year, lcolor(gs2) lwidth(thin)), legend(order(1 "Control" 3 "Treatment") title("Group", size(small))) ytitle("Presidential Vote Share", size(small)) xtitle("Year (Treatment Period: 2010-2014)", size(small)) ylabel(40(5)60) xlabel(2000(4)2016) xline(2012, lwidth(30) lcolor(gs14%50) lpattern(solid)) // Figure C1

//H2
use "Blum & Cowburn Data.dta", clear
drop placebo_h2
gen placebo_h2 = 1 if pvi08 > 0 
recode placebo_h2 (.=0)
diff district_nokkenpoole if year ==2008 | year==2016 [aweight = iwps3], t(placebo_h2) p(posttreatment) cl(geoid) // no movement H2
outreg2 using table_diff, ctitle(Legislator Position) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3)

use "Blum & Cowburn Data.dta", clear 
collapse (mean) district_nokkenpoole (sem) se_district_nokkenpoole = district_nokkenpoole [aweight = iwps3], by(year placebo_h2)
drop if year == 2000 | year == 2018
gen upper_ci = district_nokkenpoole + (se_district_nokkenpoole*1.96)
gen lower_ci = district_nokkenpoole - (se_district_nokkenpoole*1.96)
reshape wide district_nokkenpoole se_district_nokkenpoole upper_ci lower_ci, i(year) j(placebo_h2)
replace year = 109 in 1
replace year = 110 in 2
replace year = 111 in 3
replace year = 112 in 4
replace year = 113 in 5
replace year = 114 in 6
replace year = 115 in 7
graph twoway (line district_nokkenpoole0 year, lcolor(gs6) lpattern(dash) lwidth(thick)) (rcap upper_ci0 lower_ci0 year, lcolor(gs6) lpattern(dash) lwidth(thin)) (line district_nokkenpoole1 year, lcolor(gs2) lwidth(thick)) (rcap upper_ci1 lower_ci1 year, lcolor(gs2) lwidth(thin)), legend(order(1 "Control" 3 "Treatment") title("Group", size(small))) ytitle("Legislator Position", size(small)) xtitle("Congress (Treatment Period: 112th–114th Congress)", size(small)) xlabel(109(1)115) xline(113, lwidth(50) lcolor(gs14%50) lpattern(solid)) // Figure C2

// Placebo Test with Random Dates
use "Blum & Cowburn Data.dta", clear 
diff recent_presidential_share if year_placebo ==2008 | year_placebo ==2016 [aweight = iwps3], t(tp3interacted) p(posttreatment_placebo) cl(geoid) // year_placebo generated using shufflevar to randomly assign dates
outreg2 using table_diff, ctitle(Pres Vote Share) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3) replace 

use "Blum & Cowburn Data.dta", clear 
collapse (mean) recent_presidential_share (sem) se_recent_presidential_share = recent_presidential_share [aweight = iwps3], by(year_placebo tp3interacted)
drop if year_placebo == 2018 | year == 2006 | year == 2010 | year == 2014
gen upper_ci = recent_presidential_share + (se_recent_presidential_share*1.96)
gen lower_ci = recent_presidential_share - (se_recent_presidential_share*1.96)
reshape wide recent_presidential_share se_recent_presidential_share upper_ci lower_ci, i(year) j(tp3interacted)
graph twoway (line recent_presidential_share0 year, lcolor(gs6) lpattern(dash) lwidth(thick)) (rcap upper_ci0 lower_ci0 year, lcolor(gs6) lpattern(dash) lwidth(thin)) (line recent_presidential_share1 year, lcolor(gs2) lwidth(thick)) (rcap upper_ci1 lower_ci1 year, lcolor(gs2) lwidth(thin)), legend(order(1 "Control" 3 "Treatment") title("Group", size(small))) ytitle("Presidential Vote Share", size(small)) xtitle("Year (Treatment Period: 2010-2014)", size(small)) ylabel(40(5)55) xlabel(2000(4)2016) xline(2012, lwidth(30) lcolor(gs14%50) lpattern(solid)) // Figure C3

use "Blum & Cowburn Data.dta", clear 
diff district_nokkenpoole if year_placebo ==2008 | year_placebo==2016 [aweight = iwps3], t(tp3interacted) p(posttreatment_placebo) cl(geoid) 
outreg2 using table_diff, ctitle(Legislator Position) addstat(Mean Control 2008, r(mean_c0), SE Control 2008, r(se_c0), Mean Treated 2008, r(mean_t0), SE Treated 2008, r(se_t0), Diff 2008, r(diff0), Diff 2008 SE, r(se_d0), Mean Control 2016, r(mean_c1), SE Control 2016, r(se_c1), Mean Treated 2016, r(mean_t1), SE Treated 2016, r(se_t1), Diff 2016, r(diff1), Diff 2016 SE, r(se_d1)) label word nocons dec(3)

use "Blum & Cowburn Data.dta", clear 
collapse (mean) district_nokkenpoole (sem) se_district_nokkenpoole = district_nokkenpoole [aweight = iwps3], by(year_placebo tp3interacted)
drop if year_placebo == 2000 | year == 2018
gen upper_ci = district_nokkenpoole + (se_district_nokkenpoole*1.96)
gen lower_ci = district_nokkenpoole - (se_district_nokkenpoole*1.96)
reshape wide district_nokkenpoole se_district_nokkenpoole upper_ci lower_ci, i(year_placebo) j(tp3interacted)
replace year = 109 in 1
replace year = 110 in 2
replace year = 111 in 3
replace year = 112 in 4
replace year = 113 in 5
replace year = 114 in 6
replace year = 115 in 7
graph twoway (line district_nokkenpoole0 year_placebo, lcolor(gs6) lpattern(dash) lwidth(thick)) (rcap upper_ci0 lower_ci0 year_placebo, lcolor(gs6) lpattern(dash) lwidth(thin)) (line district_nokkenpoole1 year_placebo, lcolor(gs2) lwidth(thick)) (rcap upper_ci1 lower_ci1 year_placebo, lcolor(gs2) lwidth(thin)), legend(order(1 "Control" 3 "Treatment") title("Group", size(small))) ytitle("Legislator Position", size(small)) xtitle("Congress (Treatment Period: 112th–114th Congress)", size(small)) xlabel(109(1)115) xline(113, lwidth(50) lcolor(gs14%50) lpattern(solid)) // Figure C4

use "Blum & Cowburn Data.dta", clear 